import Main from '@/views/Main.vue';


// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
	path: '/login',
	name: 'login',
	meta: {
		title: 'Login - 登录'
	},
	component: () => import('@/views/login.vue')
};

export const page404 = {
	path: '/*',
	name: 'error_404',
	meta: {
		title: '404-页面不存在'
	},
	component: () => import('@/views/error_page/404.vue')
};

export const page403 = {
	path: '/403',
	meta: {
		title: '403-权限不足'
	},
	name: 'error_403',
	component: () => import('@/views/error_page/403.vue')
};

export const page500 = {
	path: '/500',
	meta: {
		title: '500-服务端错误'
	},
	name: 'error_500',
	component: () => import('@/views/error_page/500.vue')
};

export const locking = {
	path: '/locking',
	name: 'locking',
	component: () => import('@/views/main_components/lock_screen/components/locking-page.vue')
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
	path: '/',
	name: 'otherRouter',
	redirect: '/home',
	component: Main,
	children: [{
			path: 'home',
			title: {
				i18n: 'home'
			},
			name: 'home_index',
			component: () => import('@/views/home/home.vue')
		},
		{
			path: 'own',
			title: '个人中心',
			name: 'own_index',
			component: () => import('@/views/own/index.vue')
		},
		{
			path: 'request/:hash',
			title: '请求参数',
			name: 'interface_request',
			component: () => import('@/views/interface/request.vue')
		},
		{
			path: 'response/:hash',
			title: '返回参数',
			name: 'interface_response',
			component: () => import('@/views/interface/response.vue')
		},
		{
			path: "order_details",
			icon: "ios-document-outline",
			name: "order_details",
			title: "订单详情",
			access: 'backstage/Order/detail',
			component: () => import('@/views/order/list_details.vue')
		},

	]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [
	{
		path: '/system',
		icon: 'ios-build',
		name: 'system',
		title: '系统配置',
		component: Main,
		children: [{
				path: 'menu',
				icon: 'md-menu',
				name: 'menu',
				access: 'backstage/Menu/index',
				title: '菜单维护',
				component: () => import('@/views/system/menu.vue')
			},
			{
				path: 'user',
				icon: 'ios-people',
				name: 'user',
				access: 'backstage/User/index',
				title: '后台管理员管理',
				component: () => import('@/views/system/user.vue')
			},
			{
				path: 'auth',
				icon: 'md-warning',
				name: 'auth',
				access: 'backstage/Auth/index',
				title: '权限管理',
				component: () => import('@/views/system/auth.vue')
			},
			{
				path: 'log',
				icon: 'md-list-box',
				name: 'log',
				access: 'backstage/Log/index',
				title: '操作日志',
				component: () => import('@/views/system/log.vue')
			}
		]
	},
	{
		path: '/abnormalConfig',
		icon: 'ios-build',
		name: 'AbnormalConfig',
		title: '异常信息归类',
		component: Main,
		children: [{
				path: 'list',
				icon: 'md-menu',
				name: 'list',
				access: 'backstage/Menu/index',
				title: '异常原因列表',
				component: () => import('@/pages/abnormalConfig/index.vue')

			},
			{
				path: 'record',
				icon: 'ios-people',
				name: 'record',
				access: 'backstage/User/index',
				title: '异常采集记录',
				component: () => import('@/pages/abnormalConfig/record.vue')
			},

		]
	},
	{
		path: '/platform',
		icon: 'ios-build',
		name: 'Platform',
		title: '平台管理',
		component: Main,
		children: [{
				path: 'list',
				icon: 'md-menu',
				name: 'platformList',
				access: 'backstage/Platform/index',
				title: '平台列表',
				component: () => import('@/pages/platform/index.vue')
	
			},

	
		]
	},
	{
		path: '/user',
		icon: 'ios-build',
		name: 'user',
		title: '用户管理',
		component: Main,
		children: [{
				path: 'list',
				icon: 'md-menu',
				name: 'userList',
				access: 'backstage/user/list',
				title: '用户列表',
				component: () => import('@/pages/user/list.vue')
	
			},
	
	
		]
	},



];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
	loginRouter,
	otherRouter,
	locking,
	...appRouter,
	page500,
	page403,
	page404
];
